local players = game:GetService("Players") local runService = game:GetService("RunService") local tweenService = game:GetService("TweenService") local debris = game:GetService("Debris") local plr = owner local chr = plr.Character local root = chr:WaitForChild("HumanoidRootPart") local hum = chr:WaitForChild("Humanoid") local loc = 0 local camLoc = 0 local targ = nil local x,y,z = 0,0,0 local dist = 20 local held = false local MHeld, NHeld = false, false local flingMode = false -- local lastPos = 0 -- local flingVel = 0 -- // util function Joint(p0,p1,c0,c1,name) local weld = Instance.new("Weld") weld.Part0, weld.Part1, weld.C0, weld.C1, weld.Name = p0,p1,c0,c1,name weld.Parent = p0 return weld end function Create(obj,...) local thing = Instance.new(obj) local par = nil for i,v in next, (...) do if tostring(i) ~= "Parent" then thing[i] = v else par = v end end if par ~= nil then thing.Parent = par end return thing end -- // brick local default = "rbxassetid://4672853374" local grabColor = Color3.new(1,0,0) local brick = Create("Part",{ Parent = script, BrickColor = BrickColor.new("New Yeller"), CanCollide = false, Anchored = true, Locked = true, Transparency = 1, Name = "Brick" .. owner.Name, Size = Vector3.new(1,1,1) }) local bbg = Create("BillboardGui",{ Parent = brick, Adornee = brick, Size = UDim2.new(5,0,5,0), AlwaysOnTop = true }) local image = Create("ImageLabel",{ Parent = bbg, Size = UDim2.new(1,0,1,0), Image = default, BackgroundTransparency = 1 }) local snatch = Create("Sound",{ Parent = brick, Volume = 4, SoundId = "rbxassetid://4458750863" }) local weee = Create("Sound",{ Parent = brick, Volume = 4, SoundId = "rbxassetid://711753382" }) local click = Create("Sound",{ Parent = brick, Volume = 4, SoundId = "rbxassetid://537744814" }) local click2 = Create("Sound",{ Parent = brick, Volume = 4, SoundId = "rbxassetid://1612774981" }) runService.Heartbeat:Connect(function() if brick ~= nil then pcall(function() lastPos = brick.Position brick.CFrame = brick.CFrame:Lerp(CFrame.new(camLoc,loc) * CFrame.new(0,0,-dist),.5) flingVel = (brick.Position - lastPos).unit end) end if held then if targ ~= nil then pcall(function() targ.CFrame = targ.CFrame:Lerp(CFrame.new(brick.Position) * CFrame.Angles(x,y,z),.5) end) end end if MHeld then dist += 1 elseif NHeld then dist -= 1 end dist = math.clamp(dist, 10, 100) end) -- // remote stuff local remf = Create("RemoteFunction",{ Parent = owner.PlayerGui, Name = "MouseRep" }) remf.OnServerInvoke = function(plr,mHit,camPos) loc = mHit camLoc = camPos end local remev = Create("RemoteEvent",{ Parent = owner.PlayerGui, Name = "KeyBinds" }) remev.OnServerEvent:Connect(function(plr,inp,inpType,mTarg) if inp == "Button1Down" then if inpType == "KeyDown" then held = true pcall(function() if typeof(mTarg) == "Instance" then if string.find(mTarg.Name,"Base") then return end snatch:Play() targ = mTarg targ.Anchored = true x,y,z = targ.CFrame:ToEulerAnglesYXZ() image.ImageColor3 = grabColor end end) elseif inpType == "KeyUp" then held = false pcall(function() targ.Anchored = false image.ImageColor3 = Color3.new(1,1,1) if flingMode then local vel = Create("BodyVelocity",{ Parent = targ, MaxForce = Vector3.new(99e99,99e99,99e99), Velocity = (flingVel * 200) + Vector3.new(0,5,0) }) debris:AddItem(vel,.1) end targ = nil end) end elseif inp == Enum.KeyCode.E then if inpType == "KeyDown" then if held then pcall(function() if typeof(targ) == "Instance" then click2:Play() targ:BreakJoints() targ.Parent = workspace end end) end end elseif inp == Enum.KeyCode.Q then if inpType == "KeyDown" then if held then pcall(function() if typeof(targ) == "Instance" then weee:Play() image.ImageColor3 = Color3.new(1,1,1) held = false targ.Anchored = false local vel = Create("BodyVelocity",{ Parent = targ, MaxForce = Vector3.new(99e99,99e99,99e99), Velocity = (brick.CFrame.LookVector * 150) + Vector3.new(0,5,0) }) debris:AddItem(vel,.1) targ = nil end end) end end elseif inp == Enum.KeyCode.R then if inpType == "KeyDown" then if held then pcall(function() if typeof(targ) == "Instance" then click:Play() image.ImageColor3 = Color3.new(1,1,1) held = false targ.Anchored = true targ = nil end end) end end elseif inp == Enum.KeyCode.F then if inpType == "KeyDown" then flingMode = not flingMode print("Fling mode " .. tostring(flingMode)) end elseif inp == Enum.KeyCode.M then MHeld = inpType == "KeyDown" elseif inp == Enum.KeyCode.N then NHeld = inpType == "KeyDown" end end) NLS([[ local mse = owner:GetMouse() local remev = owner:FindFirstChildOfClass("PlayerGui"):FindFirstChild("KeyBinds") spawn(function() mse.TargetFilter = workspace:FindFirstChild("Brick" .. owner.Name,true) end) local UIS = game:GetService("UserInputService") local runService = game:GetService("RunService") mse.Button1Down:Connect(function() remev:FireServer("Button1Down","KeyDown",mse.Target) end) mse.Button1Up:Connect(function() remev:FireServer("Button1Down","KeyUp",mse.Target) end) UIS.InputBegan:Connect(function(inp,gp) if not gp then remev:FireServer(inp.KeyCode,"KeyDown") end end) UIS.InputEnded:Connect(function(inp,gp) if not gp then remev:FireServer(inp.KeyCode,"KeyUp") end end) runService.RenderStepped:Connect(function() pcall(function() local remf = owner:FindFirstChildOfClass("PlayerGui"):FindFirstChild("MouseRep") if remf ~= nil then remf:InvokeServer(mse.Hit.p,workspace.CurrentCamera.CFrame.p) end end) end)]],owner.PlayerGui)